package com.isnmp.nms.framework.discover.rstype;

import com.isnmp.common.snmp.mib.MibDiskAndMemoEntry;
import com.isnmp.nms.framework.discover.ResourceInfo;

public class MemoryType extends SNMPTableBasicMothType {
    public MemoryType() {
        setResoureTypeName(Messages.getString("MemoryType.0"));
    }

    public Class getORMappingClass() {
        return MibDiskAndMemoEntry.class;
    }

    public String getResourceSearchMoth() {
        return Messages.getString("MemoryType.1");
    }

    public ResourceInfo tableMibInfoToResouce(Object paramObject) {
        ResourceInfo localResourceInfo = new ResourceInfo();
        MibDiskAndMemoEntry diskAndMemEntry = (MibDiskAndMemoEntry) paramObject;
        String str = diskAndMemEntry.getHrStorageType();
        System.out.println(diskAndMemEntry.toString());
        if ((str.equalsIgnoreCase("1.3.6.1.2.1.25.2.1.2")) || (str.equalsIgnoreCase("1.3.6.1.2.1.25.2.1.3"))) {
            localResourceInfo.setResourceRSIDValue(diskAndMemEntry.getHrStorageIndex() + "");
            localResourceInfo.setResourceName(diskAndMemEntry.getHrStorageDescr());
            localResourceInfo.setResourceParam(Messages.getString("MemoryType.5") + diskAndMemEntry.getHrStorageSize() * diskAndMemEntry.getHrStorageAllocationUnits() / 1024 / 1024);
            localResourceInfo.setResourceDesc(Messages.getString("MemoryType.6") + diskAndMemEntry.getHrStorageType());
            localResourceInfo.setResrouceRemarks(getTypeDesc());
            return localResourceInfo;
        }
        return null;
    }
}